package edu.hunau.cxb19.oop.class03;

/**
 * 描述平面中的图形
 * 
 * @author hb
 *
 *         2020-02-26 16:12:30
 */
public class Shape {
	/**
	 * 图形定位的点
	 */
	private Point location;

	/**
	 * @param location
	 */
	public Shape(Point location) {
		super();
		this.location = location;
	}

	/**
	 * 
	 */
	public Shape() {
		super();
	}

	/**
	 * 获得当前图形的面积
	 * 
	 * @return
	 */
	public double area() {
		return -1;
	}

	/**
	 * @return the location
	 */
	public Point getLocation() {
		return location;
	}

	/**
	 * @param location the location to set
	 */
	public void setLocation(Point location) {
		this.location = location;
	}

	/**
	 * 判定一个点是否在图形的内部
	 * 
	 * @param p
	 * @return
	 */
	public boolean contains(Point p) {
		return false;
	}

	public boolean contains(int x, int y) {
		return this.contains(new Point(x, y));
	}

}
